﻿using System.Globalization;
using TotalApplication.AngelSix;

namespace TotalApplication.Mine_Video
{
    public class TagItem_EditToIcon : BaseValueConverter<TagItem_EditToIcon>
    {
        public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            bool isEdit = (bool)value;
            if(isEdit)
                // Edit icon
                return "\uf00d";
            else
                // Tag icon
                return "\uf005";
        }

        public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

    public class TagItem_BoolToIconColor : BaseValueConverter<TagItem_BoolToIconColor>
    {
        public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            bool isTop = (bool)value;
            if(parameter != null)
            {
                bool HasChild = isTop;
                if (HasChild)
                    return "#ffa800";
                else
                    return "#B0B0B0";
            }
            else
            {
                if (isTop)
                    // Edit icon
                    return "#FFF000";
                else
                    // Tag icon
                    return "#FFFFFF";
            }
        }

        public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
